<script language="javascript" type="text/javascript">
/*<![CDATA[*/
	$(function(){
		$("#lnkSave").click(function(){
			$('#adminForm').submit();
		});

		$("#lnkClose").click(function(){
			window.location = '<?php echo DOMAIN?>/slideshows';
		});

		$("#adminForm").validate({
			rules: {
				txtten: "required",
				txtlink: "required",
				userfile: "required",
				vitri: "required",
			},
			messages: {
				txtten: "Bạn chưa nhập tên!",
				txtlink: "Bạn chưa nhập link!",
				userfile: "Bạn chưa nhập ảnh!",
				vitri: "Bạn chưa nhập địa chỉ!",
			}
		});
	});
/*]]>*/
</script>
<div id="content-box">
	<div class="border">
		<div class="padding">
			<div id="toolbar-box">
   			<div class="t"><div class="t"><div class="t"></div></div></div>
			<div class="m">
				<div class="toolbar" id="toolbar">
				<table class="toolbar">
				<tr>
					<td class="button" id="toolbar-save">
					<a href="javascript:;//Cập nhật" id="lnkSave" class="toolbar">
						<span class="icon-32-save" title="Cập nhật"></span>
						Cập nhật
					</a>
					</td>
					<td class="button" id="toolbar-cancel">
					<a href="javascript:;//Đóng" id="lnkClose" class="toolbar">
						<span class="icon-32-cancel" title="Đóng"></span>
						Đóng
					</a>
					</td>
				</tr>
				</table>
				</div>
				<div class="header icon-48-langmanager">Chi tiết </div>
				<div class="clr"></div>
			</div>
			<div class="b"><div class="b"><div class="b"></div></div></div>
			</div>
			<div class="clr"></div>
			<div id="element-box">
				<div class="t"><div class="t"><div class="t"></div></div></div>
				<div class="m">
				<form action="<?php echo DOMAIN?>/quang_cao/edit" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data"  autocomplete="off">
					<div class="col width-50">
						<fieldset class="adminform">
						<legend>Thông tin chi tiết</legend>
						<table class="admintable" cellspacing="1">
						<tr>
							<td width="150" class="key">
								<label for="txtten">Tên</label>
							</td>
							<td>
                             <?php echo $form->input('Slideshow.name',array( 'label' => '','id'=>'txtten','class'=>'inputbox','size'=>'60'));?>
							 <?php echo $this->Form->input('Slideshow.id',array('label'=>''));?>
							</td>
						</tr>
						<tr>
							<td class="key">
								<label for="txtlink">Link</label>
							</td>
							<td>
								
                                 <?php echo $form->input('Slideshow.url',array( 'label' => '','id'=>'txtlink','class'=>'inputbox','size'=>'60'));?>
							</td>
						</tr>
						<tr>
							<td class="key">
								<label for="txtImage">Ảnh</label>
							</td>
							<td>
								<?php echo $this->Form->input('Slideshow.images',array('class'=>'inputbox','id'=>'txtImage','size'=>'40','label'=>false,'readonly'=>true,'id'=>'imagesid')); ?> 
    <div style="position:relative; top:-20px; left:240px;"><a href="javascript:window.open('<?php echo DOMAIN; ?>/upload.php','images','left=400,top=100,width=500,height=300');window.history.go(1)">Upload</a></div>
							</td>
						</tr>
						<tr>
							<td class="key">
								<label for="txtthutu">Thứ tự</label>
							</td>
							<td>
								
                                <?php echo $form->input('Slideshow.order',array( 'label' => '','id'=>'txtthutu','class'=>'inputbox','size'=>'20'));?>
							</td>
						</tr>
						
                        
						 
						<tr>
							<td class="key">
								<label for="rdtrangthai">Trạng thái</label>
							</td>
							<td>
								  <?php 
								  if($this->data['Slideshow']['status']==1){
								   echo $form->radio('Slideshow.status', array(0 => 'đóng', 1 => 'hoạt động'), array('value' => '1','legend'=>''));
								  } else {
									  echo $form->radio('Slideshow.status', array(0 => 'đóng', 1 => 'hoạt động'), array('value' => '0','legend'=>''));
									 }?>
							</td>
						</tr>
						
					
						</table>
						</fieldset>
					</div>
					<div class="col width-50">
						<fieldset class="adminform">
						<legend>Hiển thị</legend>
						<table cellspacing="1" class="admintable">
						<tbody>
						<tr>
							<td>
								<div class="functionBtnEvent" >                                 
                                  <?php if($this->data['Slideshow']['images'] == "") {$imagesnow="img/no-images.jpg";} else {
		$imagesnow=$this->data['Slideshow']['images'];
		}?>
    <img id="images-default" name="imagesdefault" src="<?php echo DOMAIN ?>/<?php echo $imagesnow;?>" style="padding-right:10px; width:475px;"></img>
                                 </div>
							</td>
						</tr>
						</tbody></table>
						</fieldset>
					</div>
					<div class="clr"></div>
					<input type="hidden" name="hndId" id="hndId" value="<?php //echo $id?>" />
				</form>
				<div class="clr"></div>
				</div>
				<div class="b"><div class="b"><div class="b"></div></div></div>
			</div>
			<noscript>Warning! JavaScript must be enabled for proper operation of the Administrator back-end.</noscript>
			<div class="clr"></div>
		</div>
		<div class="clr"></div>
	</div>
</div>

